Wire reproducible seed into native build - #196
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts the reproducible-
seedversion of the amica15 source (sccn/amica PR #54, supersedes #53) into pyAMICA's native binary build. The CI-built release binaries (release-binaries.yml) now support aseedoption ininput.param: a run's random initialization is reproducible whenseedis set, clock-random otherwise.Change
native/patch_sources.py: the build-time seed patch now applies PR Refuse degenerate fits in the AMICA wrapper (#50) #54's version instead of Return best iterate from AMICATorchNG.fit (#51) #53's. It (1) sizesrandom_seed(PUT=...)viarandom_seed(SIZE=...)(portable across ifort/gfortran, as before) and (2) wires aseedparam -> deterministic per-rank seeding when set. Four idempotent, anchor-verified patches (header decls, seed logic, BCAST, parser case).pamica/amica15.f90stays the pristine parity reference (== sccn/amica master); only the build copy is patched, as before.validate_shim.sh's--pin-seedstill works (pins the unseeded/clock branch for the bit-for-bit shim-vs-mpif90 comparison).Testing
Built the shim binary locally (Apple Silicon gfortran) and ran the bundled 32-ch sample, single-threaded (deterministic reductions):
seed 42: W byte-identical (LL -3.4570950991 both) -> reproducible.seed: W differs (LL -3.4571252798 vs -3.4571719932) -> clock-random.--pin-seedapplies cleanly (3 anchors, clock pinned); ruff + ty pass.Notes
release-binaries.ymlon a release (or manualworkflow_dispatch), not on this merge -- cut a release / dispatch to publish binaries carrying the option.seedthrough theAMICANativePython engine (pass from Python, not just a hand-writteninput.param) is a natural follow-up.